function showWindow(title,url,width,height){
	var win = new Ext.Window({
		title:title,
		html:"<iframe width="+width+" height="+height+" frameborder=0 scrolling=auto src='"+url+"'></iframe>",
		modal:true
	});
	win.show();
}
function create_gridpanel(options){
	
	var proxy = new Ext.data.HttpProxy({url:options.url});
	
	var record = options.record;
	
	var reader = new Ext.data.JsonReader({totalProperty:"totalProperty",root:"root"},record);
	
	var store = new Ext.data.Store({
		proxy:proxy,
		reader:reader
	});
	
	var params = {};
	if(options.params){
		params = options.params;
	}
	if(options.start){
		params.start = options.start;
	}
	if(options.limit){
		params.limit= options.limit;
	}
	store.load({params:params,
		callback:function(r,options,success){
			if(!success){
				Ext.Msg.alert("查询失败","查询失败，请稍候再试！");
			}
		}});
	
	var gridPanelConfig = {
			autoHeight:true,
			cm:options.cm,
			sm:options.sm,
			store:store,
			remoteSort:options.remoteSort,
			title:options.title,
			width:options.width,
			autoExpandColumn:options.autoExpandColumnId,
			buttonAlign:options.buttonAlign,
			buttons:options.buttons
	};
	if(options.tbar){
		gridPanelConfig.tbar=options.tbar;
	}
	if(options.showBottomBar){
		gridPanelConfig.bbar = new Ext.PagingToolbar({
			store:store,
			pageSize:options.limit,
			displayInfo:true,
			displayMsg:"本页显示第{0}条到第{1}条记录，共{2}条",
			emptyMsg:"没有符合条件的记录"
		});
	}
	var p = new Ext.grid.GridPanel(gridPanelConfig);
	p.getView().scrollOffset=0;
	return p;
}
